﻿<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <title>管理员登录</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="./static/css/indexstyle.css" rel="stylesheet" type="text/css" media="all" />
    <link href="https://magicbox.bk.tencent.com/static_api/v3/assets/bootstrap-3.3.4/css/bootstrap.min.css" rel="stylesheet">
    <link href="./static/css/jquery-confirm.min.css" rel="stylesheet" media="screen" />
    <script href="./static/js/jquery-3.js"></script>
    <script src="https://magicbox.bk.tencent.com/static_api/v3/assets/js/jquery-1.10.2.min.js"></script>
    <script src="./static/js/jquery-confirm.min.js"></script>
</head>
<body>
    <div class="main">
        <h1>管理员登录</h1>
        <div>
            <input type="text" id="user" placeholder="用户名" >
            <input type="password" id="passwordInfo" placeholder="密码" >
            <button id="bt1" type="button" onclick="submitInfo()">登录</button>
        </div>
    </div>
</body>
<script type="text/javascript">
    function submitInfo(){
        $.ajax({
            url: "{{url_for('checkAdmin')}}",
            type: "post",
            data: {
                user: $("#user").val(),
                passwordInfo: $("#passwordInfo").val()
            },
            success:function (data) {
                console.log(data);
                if (data['code']===1){
                    window.location.href = data['url']
                }else{
                    $.dialog({
                        title: '登录失败',
                        content: data['msg']
                    });
                }
            }
        })
    }
</script>
</html>